package io.renren.modules.busi.service.impl;

import io.renren.modules.sys.entity.SysDept1Entity;
import org.springframework.stereotype.Service;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import io.renren.common.utils.PageUtils;
import io.renren.common.utils.Query;

import io.renren.modules.busi.dao.B63AverageSpeedPeakDao;
import io.renren.modules.busi.entity.B63AverageSpeedPeakEntity;
import io.renren.modules.busi.service.B63AverageSpeedPeakService;


@Service("b63AverageSpeedPeakService")
public class B63AverageSpeedPeakServiceImpl extends ServiceImpl<B63AverageSpeedPeakDao, B63AverageSpeedPeakEntity> implements B63AverageSpeedPeakService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
//        String typecode=params.get("typecode").toString();
//        IPage<B63AverageSpeedPeakEntity> page = this.page(
//                new Query<B63AverageSpeedPeakEntity>().getPage(params),
//                new QueryWrapper<B63AverageSpeedPeakEntity>().eq("type_code",typecode)
//        );
        String createby=params.get("createby").toString();
        IPage<B63AverageSpeedPeakEntity> page = this.page(
                new Query<B63AverageSpeedPeakEntity>().getPage(params),
                new QueryWrapper<B63AverageSpeedPeakEntity>().eq("creatby",createby)
        );
        return new PageUtils(page);
    }

    public PageUtils queryPageforDistrict(Map<String, Object> params) {
        String typecode=params.get("typecode").toString();
        System.out.println("typecode is "+typecode+"**********");
        IPage<B63AverageSpeedPeakEntity> page = this.page(
                new Query<B63AverageSpeedPeakEntity>().getPage(params),
                new QueryWrapper<B63AverageSpeedPeakEntity>().like("type_code",typecode)
        );
        return new PageUtils(page);
    }
}
